package com.ebelter.bodyfatscale.broadcastreceivers;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.ebelter.btlibrary.util.ULog;

/**
 * 语言改变监听器
 */

public class LocaleChangeReceiver extends BroadcastReceiver {

    private static final String TAG = "LocaleChangeReceiver";
    @Override
    public void onReceive(Context context, Intent intent) {
        ULog.i(TAG,"-------LocaleChangeReceiver------");
//        ToastUtil.show("Restart App");
//        ActivityManagers.getInstance().exit();
//        restartApplication(context);
    }
    private void restartApplication(Context context) {

        final Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
        if (intent != null) {
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            context.startActivity(intent);
        }

    }
}
